package com.decent.ejfadmin.utils;

/**
 * describe:mysql工具类
 *
 * @author 陈豆豆
 * @date 2019/09/07
 */
public final class SQLWrapUtils {
    public static String wrapPage(StringBuffer sql, int beginNumber, int endNumber) {
        sql.append(" limit ").append(beginNumber).append(" , ").append(endNumber);
        return sql.toString();
    }

    public static String wrapPage(StringBuilder sql, int beginNumber, int endNumber) {
        sql.append(" limit ").append(beginNumber).append(" , ").append(endNumber);
        return sql.toString();
    }

    public static void generateSqlArrParam(StringBuffer sql, String[] ids) {
        for (int i = 0; i < ids.length; i++) {
            sql.append(ids[i]);
            if (i < ids.length - 1) {
                sql.append(",");
            }
            if (i == 999) {
                break;
            }
        }
    }
}
